#!/bin/bash

usage ()
{
        echo $"Usage: $0 [-j JAVA_HOME] [-d NMS_HOME]" 
	exit 0
}

Cur_Dir=$(pwd)
JAVA_HOME=$Cur_Dir/jdk
NMS_HOME=$Cur_Dir

while getopts "j:d:" opt
do
	case $opt in
		j ) JAVA_HOME=$OPTARG ;;
		d ) NMS_HOME=$OPTARG ;;
		? ) usage ;;
	esac
done

simplenms=$NMS_HOME
dependencies=$simplenms/dependencies
CLASS_PATH=$dependencies/:$dependencies/*:$simplenms/*:$simplenms/

"$JAVA_HOME/bin/java" -server -cp $CLASS_PATH -Xms1024m -Xmx1024m  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="/tmp" com.qf.cx.simplenms.webservice.Application 
